package cn.appsys.service.backend;

import cn.appsys.dao.backenduser.UserLoginMapper;
import cn.appsys.pojo.AppCategory;
import cn.appsys.pojo.AppInfo;
import cn.appsys.pojo.BackendUser;
import cn.appsys.pojo.DataDictionary;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class UserLoginServiceImp implements UserLoginService {
     @Resource
    private UserLoginMapper userLoginMapper;


    @Override
    public BackendUser checkLogin(String userCode,String userPassword) {
        BackendUser backendUser= userLoginMapper.getLoginUser(userCode);
        if (backendUser!= null && backendUser.getUserPassword().equals(userPassword)){
            return  backendUser;
        }
        return null;
    }

    @Override
    public List<AppInfo> getAppInfoListBiz(String querySoftwareName, Integer queryCategoryLevel1, Integer queryCategoryLevel2, Integer queryCategoryLevel3, Integer queryFlatformId) {
        return userLoginMapper.getAppInfoList(querySoftwareName,queryCategoryLevel1,queryCategoryLevel2,queryCategoryLevel3,queryFlatformId);
    }
    @Override
    public List<AppCategory> categoryLevel1ListBzi(AppCategory appCategory) {
        return userLoginMapper.categoryLevel1List(appCategory);
    }

    @Override
    public List<DataDictionary> appFlatformBiz() {
        return userLoginMapper.appFlatform();
    }

    @Override
    public List<AppCategory> oneSortBiz() {
        return userLoginMapper.oneSort();
    }

    @Override
    public AppInfo selectBiz(int id,int vid ) {
        return userLoginMapper.select(id,vid);
    }

    @Override
    public int updateuserBiz(AppInfo appInfo) {
        return userLoginMapper.updateuser(appInfo);
    }

    @Override
    public int updatenoBiz(AppInfo appInfo) {
        return userLoginMapper.updateno(appInfo);
    }


}
